 <template>
     <div class="ArcGisMapServerImageryProvider">
         <cesium-viewer @viewerAlready="viewerAlready">
         </cesium-viewer>
         <div>
             <highlight-js code-type="javascript">
                 {{ textHtml }}
             </highlight-js>
         </div>
     </div>
 </template>

 <script>
     import CesiumViewer from "../../CesiumViewer";
     import {addAdditionalLayerOption} from "../../../utils/layersHandler";
     import HighlightJs from "../../HighlightJs";

     export default {
         name: "ArcGisMapServerImageryProvider",
         //import引入的组件需要注入到对象中才能使用",
         components: {HighlightJs, CesiumViewer},
         data() {
             //这里存放数据",
             return {
                 textHtml: '          viewer.imageryLayers.addImageryProvider(new Cesium.ArcGisMapServerImageryProvider({\n' +
                     '                         url : \'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer\'\n' +
                     '                     }));'
             };
         },
         //方法集合",
         methods: {
             viewerAlready() {
                 addAdditionalLayerOption(
                     "ArcGisMapServerImageryProvider",
                     new Cesium.ArcGisMapServerImageryProvider({
                         url : 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
                     })
                 )
             }
         }
     }
 </script>

